/*
    Copyright 2006 Andrew Wilkinson <andrew@indiegigs.co.uk>

    This file is part of libgp2x.

    libgp2x is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    libgp2x is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with libgp2x; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef __LIB_GP2x_MESSAGES_H__
#define __LIB_GP2x_MESSAGES_H__

struct GP2x_message {
    unsigned long message;
    unsigned long value;
};

extern volatile struct GP2x_message* GP2x_read_buffer;
extern volatile struct GP2x_message* GP2x_write_buffer;
extern volatile unsigned int* GP2x_read_buffer_read;
extern volatile unsigned int* GP2x_read_buffer_write;
extern volatile unsigned int* GP2x_write_buffer_read;
extern volatile unsigned int* GP2x_write_buffer_write;
extern volatile unsigned int* GP2x_return_ready;
extern volatile unsigned long* GP2x_return_value;

#ifdef HOST_PC
// Half it for my 64 bit machine...
#define GP2x_MESSAGE_BUFFER_SIZE 32
#else
#define GP2x_MESSAGE_BUFFER_SIZE 64
#endif
#define GP2x_920_BUFFER_START 0x01D00000
#define GP2x_940_BUFFER_START 0x01D00200
#define GP2x_920_BUFFER_READ  0x01D00400
#define GP2x_920_BUFFER_WRITE 0x01D00404
#define GP2x_940_BUFFER_READ  0x01D00408
#define GP2x_940_BUFFER_WRITE 0x01D0040C
#define GP2x_RETURN_READY     0x01D00410
#define GP2x_RETURN_VALUE     0x01D00414

#endif
